#ifndef __DATATYPES_H__
#define __DATATYPES_H__

#include <vector>
#include <string>

using std::vector;
using std::string;

#include "../globals.h"


typedef unsigned int 		tDocumentNumber;
typedef unsigned int 		tOffset;
typedef unsigned int 		tStreamSize;
typedef vector<tOffset> 	tOffsetList;

/*typedef struct{
	unsigned long 	_Id;
	char 			_word[30];
} tRegDictionary;*/

class tRegDictionary{
	public:
	unsigned long 	_Id;
	char 			_word[90];
};

typedef struct{
	unsigned long	_Id;		//
	unsigned long 	_document;
	tOffset			_offset;
} tRegAuxiliary;

typedef struct{
	string word;
	tOffset offset;
} Data;

class DocsListOffsets;

typedef vector<DocsListOffsets*> tDocsOffsetList;



/******************* COSAS AUXILIARES ****************************/
#include <stdlib.h>
#include <string.h>
typedef vector<tRegDictionary> tIndice;
class Indice{
	public:
	Indice(){};
	~Indice(){};
	bool exist( tRegDictionary& data )
	{
		unsigned int i;
		
		for(i=0; i<lista.size();i++)
		{
			if ( strcmp( lista[i]._word , data._word) == 0 )
			{
				data._Id = lista[i]._Id;
				return true;
			}
		}		
		data._Id = lista.size();
		lista.push_back(data);
		return false;
	}
	private:
	tIndice lista;
};


/*****************************************************************/

#endif // __DATATYPES_H__
